<template>
  <div ref="myDiv" class="radar-echart" />
</template>

<script>
import * as echarts from 'echarts/core'
import { RadarChart } from 'echarts/charts'
import {
  CanvasRenderer
} from 'echarts/renderers'
import { TitleComponent } from 'echarts/components'
echarts.use(
  [CanvasRenderer, RadarChart, TitleComponent]
)
export default {
  name: 'Radar',
  mounted() {
    const myChart = echarts.init(this.$refs.myDiv)
    var option = {
      title: {
        text: '雷达图'
      },
      radar: {
        // shape: 'circle',
        indicator: [
          { name: '工作效率', max: 100 },
          { name: '考勤', max: 100 },
          { name: '积极性', max: 100 },
          { name: '帮助同事', max: 100 },
          { name: '自主学习', max: 100 },
          { name: '正确率', max: 100 }
        ]
      },
      series: [{
        name: '平均 vs 个人',
        type: 'radar',
        // areaStyle: {normal: {}},
        data: [
          {
            value: [80, 80, 80, 80, 80, 80],
            name: '平均水平'
          },
          {
            value: [90, 75, 95, 90, 95, 90],
            name: '个人价值'
          }
        ]
      }]
    }
    myChart.setOption(option)
  }
}
</script>

<style>
.radar-echart {
  width: 600px;
  height: 400px;
}
</style>
